#include "Matrixd.h"



Matrixd::~Matrixd(void)
{
}


void Matrixd::mult( Vector3d &vector )
{
	double x = vector.x * matrix[0][0] + vector.y * matrix[0][1] + vector.z * matrix[0][2];
	double y = vector.x * matrix[1][0] + vector.y * matrix[1][1] + vector.z * matrix[1][2];
	double z = vector.x * matrix[2][0] + vector.y * matrix[2][1] + vector.z * matrix[2][2];
	vector.x = x;
	vector.y = y;
	vector.z = z;
}

Matrixd Matrixd::mult( Matrixd &other )
{
	Matrixd result( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 );


	 for(int i = 0; i < 3; i++) {
	      for(int j = 0; j < 3; j++) {
	        for(int k = 0; k < 3; k++){
	          result.matrix[i][j] += other.matrix[i][k]*matrix[k][j];
	        }
	      }  
	     }

	return result;
}